package com.swiftride.controller.app;

import com.swiftride.pojo.dto.CarInfoDto;
import com.swiftride.result.R;
import com.swiftride.service.ICustomerCarService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Tag(name = "客户车辆", description = "客户车辆")
@RestController
@RequestMapping("/app/customerCar")
public class AppCustomerCarController {

    @Autowired
    public ICustomerCarService customerCarService;

    @Operation(summary = "获取乘客车辆信息", description = "获取乘客车辆信息接口")
    @GetMapping(value = "/list")
    public R getList() {
        return R.success(customerCarService.getList());
    }

    @Operation(summary = "保存乘客车辆信息", description = "保存乘客车辆信息接口")
    @Parameter(name = "carInfoDto", description = "保存乘客车辆信息的对象")
    @PostMapping
    public R saveCatInfo(@RequestBody CarInfoDto carInfoDto) {
        customerCarService.saveCatInfo(carInfoDto);
        return R.success();
    }
}
